//
//  RNOLLoginTool.m
//  RongNiuOnline
//
//  Created by apple on 2018/4/4.
//  Copyright © 2018年 rongniu. All rights reserved.
//

#import "RNOLLoginTool.h"

static NSString *const kUserIDKey = @"kUserIDKey";
static NSString *const kUserTokenKey = @"kUserTokenKey";
static NSString *const kNavgationBarHideOrDisplayAnimation = @"kNavgationBarHideOrDisplayAnimation";

@implementation RNOLLoginTool

+ (void)setUserID:(NSString *)user_id{
    [kUserDefaults setObject:user_id forKey:kUserIDKey];
    [kUserDefaults synchronize];
}
+ (NSString *)user_id {
    return  [kUserDefaults objectForKey: kUserIDKey];
}

+ (void)setToken:(NSString *)token{
    [kUserDefaults setObject: token forKey: kUserTokenKey];
    [kUserDefaults synchronize];
}
+ (NSString *)token{
    return [kUserDefaults objectForKey: kUserTokenKey];
}


// 记录一下导航栏隐藏于显示动画的状态  子页面全设置为YES需要动画 父页面之间不需要动画设置为NO 都是在ViewwillApear: 做事情 
+ (void)setNavgationBarNeedAnimation:(BOOL)need{
    [kUserDefaults setObject:@(need) forKey:kNavgationBarHideOrDisplayAnimation];
    [kUserDefaults synchronize];
}
+ (BOOL)neddNavgationBarAnimation{
    return [[kUserDefaults objectForKey: kNavgationBarHideOrDisplayAnimation] boolValue];
}



@end
